/* 
 * Copyright (c) 2021 iSoftStone Information Technology (Group) co., ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef __ISS_DEMO_LED_INCLUDE__
#define __ISS_DEMO_LED_INCLUDE__

#include "iss_base_type.h"

typedef enum {
    MIN_LED_STATE,
    RED_LIGHT_ON,
    RED_LIGHT_OFF,
    YELLOW_LIGHT_ON,
    YELLOW_LIGHT_OFF,
    GREEN_LIGHT_ON,
    GREEN_LIGHT_OFF,
    MAX_LED_STATE
} LedState;

// Initialize the LED pin in GPIO mode
uint32_t IssInitLedByGpio(void);
uint32_t IssTurnOnLedByGPIO(hi_gpio_idx gpioIdx);
uint32_t IssTurnOffLedByGPIO(hi_gpio_idx gpioIdx);
uint32_t IssTurnOnAllLedByGPIO(void);
uint32_t IssTurnOffAllLedByGPIO(void);

// Initialize the LED pin in PWM mode
uint32_t IssInitLedByPwm(void);
uint32_t IssTurnOffAllLedByPwm(void);
uint32_t IssTurnOnAllLedByPwm(void);
uint32_t IssPwmOut(hi_pwm_port pwmPort, uint16_t duty, uint32_t freq);
void ColorfulLampControl(void);

#endif
